<!DOCTYPE HTML>
<html lang="en" xmlns:th="http://www.springframework.org/schema/jdbc">
<head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

    <title>在线考试</title>
    <link rel="stylesheet" href="../../layui/css/layui.css">
    <script src="../../layui/layui.js"></script>
    <script>
        function child(d) {


            layui.use(['layer', 'jquery', 'table', 'form'], function () {
                let layer = layui.layer;//定义组件
                let $ = layui.jquery;//定义组件
                let table = layui.table;//定义表格组件
                let form = layui.form;//定义表格组件
                console.log("ddd" + d.questionid)
                table.render({
                    elem: '#dg1',
                    url: '../../choice/showTeaCh',
                    where: {"questionId": d.questionid},
                    method: "post",
                    parseData: function (res) {
                        return {
                            "code": 0,
                            "msg": "",
                            "count": 1000,
                            "data": res
                        }
                    },
                    cols: [[ //表头
                        {field: 'chid', title: '选择题id', type: 'checkbox'}
                        , {field: 'chquestion', title: '选择题题干'}
                        , {field: 'chquestiona', title: '选择题a'}
                        , {field: 'chquestionb', title: '选择题b'}
                        , {field: 'chquestionc', title: '选择题c'}
                        , {field: 'chquestiond', title: '选择题d'}
                        , {field: 'chanswer', title: '选择题答案'}
                        , {field: 'check', title: '解析'}
                        , {field: 'subject', title: '科目'}
                    ]]

                })
                table.render({
                    elem: '#dg2',
                    url: '/torf/showTeaTorf',
                    where: {"questionId": d.questionid},
                    method: "post",
                    parseData: function (res) {
                        return {
                            "code": 0,
                            "msg": "",
                            "count": 1000,
                            "data": res
                        }
                    },
                    cols: [[ //表头
                        {field: 'qno', title: '判断题题号', type: 'checkbox'}
                        , {field: 'question', title: '判断题题干'}
                        , {field: 'answer', title: '判断题答案'}
                        , {field: 'check', title: '判断题解析'}
                        , {field: 'subject', title: '所属科目'}
                    ]]

                })
                table.render({
                    elem: '#dg3',
                    url: '../../fillbacks/showTeaFi',
                    where: {"questionId": d.questionid},
                    method: "post",
                    parseData: function (res) {
                        return {
                            "code": 0,
                            "msg": "",
                            "count": 1000,
                            "data": res
                        }
                    },
                    cols: [[ //表头
                        {field: 'qno', title: '判断题题号', type: 'checkbox'}
                        , {field: 'question', title: '填空题题干'}
                        , {field: 'answer', title: '填空题答案'}
                        , {field: 'check', title: '解析'}
                        , {field: 'subject', title: '所属科目'}
                    ]]

                })
                table.render({
                    elem: '#dg4',
                    url: '/subjective/showTeaSub',
                    where: {"questionId": d.questionid},
                    method: "post",
                    parseData: function (res) {
                        return {
                            "code": 0,
                            "msg": "",
                            "count": 1000,
                            "data": res
                        }
                    },
                    cols: [[ //表头
                        {field: 'subid', title: '主观题id', type: 'checkbox'}
                        , {field: 'subquestion', title: '主观题题干'}
                        , {field: 'subanswer', title: '主观题答案'}
                        , {field: 'check', title: '主观题解析'}
                        , {field: 'subject', title: '所属科目'}
                    ]]

                })
            })


        }
    </script>


</head>

<body>
<h2>选择题</h2>
<table id="dg1"></table>
<h2>判断题</h2>
<table id="dg2"></table>
<h2>填空题</h2>
<table id="dg3"></table>
<h2>主观题</h2>
<table id="dg4"></table>
</body>

</html>